import request from '@g/utils/request'

export interface TypePage {
  current: number,
  size: number,
  total: number
}
export interface TypeCommonList<T> {
  records: Array<T>,
  page: TypePage
}

export interface IUploadFile {
  id?: number,
  name?: string,
  baseUrl?: string,
  path?: string,
  url?: string,
  frontUpload?: string,
  fileUrl?: string
}
// 通用文件上传
export const uploadFileApi = (data?: KeyValue) => new Promise<any>(resolve => {
  console.log(data)
  resolve({
    code: 200,
    data: { id: 1, url: 'https://dianayako-blog.oss-cn-zhangjiakou.aliyuncs.com/resource/cropper.css', name: 'cropper.css' }
    // data: { id: 1, name: '1685809144080_IMG_20230604_001749.jpg', url: 'https://dianayako-blog.oss-cn-zhangjiakou.aliyuncs.com/blog/vue3/202306/05/1685809144080_IMG_20230604_001749.jpg' }
  })
})
// 通用文件删除
export const deleteFileApi = (data?: KeyValue) => new Promise<any>(resolve => {
  console.log(data)
  resolve({
    code: 200,
    data: true
  })
})